home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Printer / djf_for_3.0 / Makefile < prev    next >
Makefile  |  1996-04-30  |  4KB  |  132 lines

  1. CC=cc
  2. # CFLAGS:
  3. #    - DEBUG        prints some comments on stderr, usually /usr/adm/lpd-errs
  4. #    - USE_1        Additionally try the compression mode 1. There is
  5. #            rarely any case where this mode is better than mode 2.
  6. #
  7. CFLAGS= -arch m68k -arch i386 -arch hppa -arch sparc -g -O -Wall
  8. #    BINDIR        Where the filter will be installed
  9. BINDIR=/usr/local/lib
  10. #    PPDDIR        Where the PPD files reside
  11. #PPDDIR=/usr/lib/NextPrinter/pdf        for 2.1
  12. PPDDIR=/NextLibrary/PrinterTypes
  13. #    PPDFILE        Name of Printer Description File
  14. #PPDFILE=HP_Deskjet_500.pdf            for 2.1
  15. PPDFILE=HP_Deskjet_500.ppd
  16. #    MANDIR        Where man pages will be installed
  17. MANDIR=/usr/local/man
  18.  
  19. #
  20. #    Change the following before issuing the "make install" rule
  21. #    TTY        Which serial port DeskJet is attached to
  22. TTY=ttyfb
  23. #    SPEED    Baud rate for serial line.  030 systems change this to 9600
  24. SPEED=19200
  25. #    PRT        Name of printer as you want it called
  26. PRT=dj
  27.  
  28. all:
  29.     @echo "There is no default target in this Makefile !"
  30.     @echo
  31.     @echo "You have two major choices:"
  32.     @echo "    choose between Deskjet(+) and Deskjet500 and Deskjet 500C/550C"
  33.     @echo "    choose the default papersize (DIN-A4 versus US-letter-format)"
  34.     @echo
  35.     @echo "So, please enter one of the following four commands"
  36.     @echo
  37.     @echo " make USdj        for Deskjet(+) and US-letter"
  38.     @echo " make EUROdj        for Deskjet(+) and DIN-A4"
  39.     @echo " make USdj500        for Deskjet500 and US-letter"
  40.     @echo " make EUROdj500        for Deskjet500 and DIN-A4"
  41.     @echo " make USdj500C        for Deskjet500C/550C and US-letter"
  42.     @echo " make EUROdj500C        for Deskjet500C/550C and DIN-A4"
  43.     @echo
  44.     @echo "This will make the choosen driver ...."
  45.     @echo
  46.     @echo "Don't forget to check the selected printerport and the"
  47.     @echo "baudrate. Both are predefined to 'ttyfb' and '19200' respectivly."
  48.     @echo "To change these values edit the defines 'TTY' and 'SPEED'"
  49.     @echo "in the makefile."
  50.     @echo
  51.     @echo "Afterwards just become root and enter 'make install' to finally install your"
  52.     @echo "new driver."
  53.  
  54. USdj:
  55.     make CFLAGS="$(CFLAGS) -DUSE_2 -DLETTER" djf
  56.  
  57. EUROdj:
  58.     make CFLAGS="$(CFLAGS) -DUSE_2 -DA4" djf
  59.  
  60. USdj500:
  61.     make CFLAGS="$(CFLAGS) -DUSE_2 -DUSE_3 -DLETTER" djf
  62.  
  63. EUROdj500:
  64.     make CFLAGS="$(CFLAGS) -DUSE_2 -DUSE_3 -DA4" djf
  65.  
  66. USdj500C:
  67.     make CFLAGS="$(CFLAGS) -DUSE_2 -DUSE_3 -DUSE_9 -DLETTER" djf
  68.  
  69. EUROdj500C:
  70.     make CFLAGS="$(CFLAGS) -DUSE_2 -DUSE_3 -DUSE_9 -DA4" djf
  71.  
  72. #########################################################
  73. #    Base rules for making djf
  74. #########################################################
  75. .psw.o:
  76.     -rm -f $*.c
  77.     $(PSWRAP) $(PSWFLAGS) -a -o $*.c $*.psw
  78.     $(CC) $(CFLAGS) -c $*.c
  79.     -rm -f $*.c
  80.  
  81. djf: djf.o djwraps.o printpage.o
  82.     $(CC) $(CFLAGS) -o djf djf.o djwraps.o printpage.o -lNeXT_s
  83.  
  84. djwraps.o: djwraps.psw
  85.  
  86. clean:
  87.     rm -f core *.o djf binfile djwraps.c
  88.  
  89. #########################################################
  90. #    Rules for installing deskjet filter and creating the new printer
  91. #########################################################
  92. install:    djf
  93.     make installit
  94.  
  95. installit:
  96.     sed -n -e "s/BBBB/$(SPEED)/g"  -e "s/PRT/$(PRT)/g"  -e "s/TTY/$(TTY)/g" -e 'w /tmp/printcap' < djf.printcap
  97.     -[ -d $(BINDIR) ] || mkdir $(BINDIR)
  98.     -[ -d $(MANDIR) ] || mkdir $(MANDIR)
  99.     -[ -d $(MANDIR)/man8 ] || mkdir $(MANDIR)/man8
  100.     -[ -d /usr/spool/NeXT/$(PRT) ] || (mkdir /usr/spool/NeXT/$(PRT); chown agent.daemon /usr/spool/NeXT/$(PRT); chmod 770 /usr/spool/NeXT/$(PRT))
  101.     @echo "Spool directory created..."
  102.     rm -f $(BINDIR)/djf
  103.     rm -f $(MANDIR)/man8/djf.8
  104.     rm -f $(BINDIR)/djint.sh
  105.     rm -f $(BINDIR)/djdf
  106.     rm -f $(BINDIR)/djif
  107.     rm -f $(BINDIR)/djgf
  108.     rm -f $(BINDIR)/djnf
  109.     rm -f $(BINDIR)/djtf
  110.     rm -f $(BINDIR)/djrf
  111.     rm -f $(BINDIR)/djvf
  112.     rm -f $(BINDIR)/djcf
  113.     rm -f $(BINDIR)/djof
  114.     cp -p djf.8 $(MANDIR)/man8
  115.     cp $(PPDFILE) $(PPDDIR)
  116.     -strip djf
  117.     cp -p djf  $(BINDIR)
  118.     cp djint.sh $(BINDIR)
  119.     ln $(BINDIR)/djint.sh $(BINDIR)/djdf
  120.     ln $(BINDIR)/djint.sh $(BINDIR)/djif
  121.     ln $(BINDIR)/djint.sh $(BINDIR)/djgf
  122.     ln $(BINDIR)/djint.sh $(BINDIR)/djnf
  123.     ln $(BINDIR)/djint.sh $(BINDIR)/djtf
  124.     ln $(BINDIR)/djint.sh $(BINDIR)/djrf
  125.     ln $(BINDIR)/djint.sh $(BINDIR)/djvf
  126.     ln $(BINDIR)/djint.sh $(BINDIR)/djcf
  127.     ln $(BINDIR)/djint.sh $(BINDIR)/djof
  128.     @echo "Filter installed in $(BINDIR) ..."
  129.     niload -v printcap . < /tmp/printcap
  130.     @echo "Printers defined to system. You may see these by 'nidump printcap .'"
  131.  
  132.